/*
 * Copyright 2025 Squircle CE contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.blacksquircle.ui.feature.editor.data.model

internal object FileAssociation {

    private val associations = HashMap<String, String>(280)

    init {
        associations[".bat"] = LanguageScope.BAT
        associations[".cmd"] = LanguageScope.BAT
        associations[".c"] = LanguageScope.C
        associations[".h"] = LanguageScope.C
        associations[".clj"] = LanguageScope.CLOJURE
        associations[".cljs"] = LanguageScope.CLOJURE
        associations[".cljc"] = LanguageScope.CLOJURE
        associations[".cljx"] = LanguageScope.CLOJURE
        associations[".clojure"] = LanguageScope.CLOJURE
        associations[".edn"] = LanguageScope.CLOJURE
        associations[".cpp"] = LanguageScope.CPP
        associations[".cc"] = LanguageScope.CPP
        associations[".cxx"] = LanguageScope.CPP
        associations[".c++"] = LanguageScope.CPP
        associations[".hpp"] = LanguageScope.CPP
        associations[".hh"] = LanguageScope.CPP
        associations[".hxx"] = LanguageScope.CPP
        associations[".h++"] = LanguageScope.CPP
        associations[".ii"] = LanguageScope.CPP
        associations[".ino"] = LanguageScope.CPP
        associations[".inl"] = LanguageScope.CPP
        associations[".ipp"] = LanguageScope.CPP
        associations[".ixx"] = LanguageScope.CPP
        associations[".tpp"] = LanguageScope.CPP
        associations[".txx"] = LanguageScope.CPP
        associations[".in"] = LanguageScope.CPP
        associations[".cs"] = LanguageScope.CSHARP
        associations[".csx"] = LanguageScope.CSHARP
        associations[".cake"] = LanguageScope.CSHARP
        associations[".css"] = LanguageScope.CSS
        associations[".scss"] = LanguageScope.CSS
        associations[".dart"] = LanguageScope.DART
        associations[".Dockerfile"] = LanguageScope.DOCKER
        associations[".Containerfile"] = LanguageScope.DOCKER
        associations[".f03"] = LanguageScope.FORTRAN
        associations[".f08"] = LanguageScope.FORTRAN
        associations[".f18"] = LanguageScope.FORTRAN
        associations[".f77"] = LanguageScope.FORTRAN
        associations[".f90"] = LanguageScope.FORTRAN
        associations[".f95"] = LanguageScope.FORTRAN
        associations[".f"] = LanguageScope.FORTRAN
        associations[".fpp"] = LanguageScope.FORTRAN
        associations[".for"] = LanguageScope.FORTRAN
        associations[".ftn"] = LanguageScope.FORTRAN
        associations[".pf"] = LanguageScope.FORTRAN
        associations[".fs"] = LanguageScope.FSHARP
        associations[".fsi"] = LanguageScope.FSHARP
        associations[".fsx"] = LanguageScope.FSHARP
        associations[".fsscript"] = LanguageScope.FSHARP
        associations[".go"] = LanguageScope.GO
        associations[".groovy"] = LanguageScope.GROOVY
        associations[".gvy"] = LanguageScope.GROOVY
        associations[".gy"] = LanguageScope.GROOVY
        associations[".gsh"] = LanguageScope.GROOVY
        associations[".gradle"] = LanguageScope.GROOVY
        associations[".Jenkinsfile"] = LanguageScope.GROOVY
        associations[".nf"] = LanguageScope.GROOVY
        associations[".html"] = LanguageScope.HTML
        associations[".htm"] = LanguageScope.HTML
        associations[".shtml"] = LanguageScope.HTML
        associations[".xhtml"] = LanguageScope.HTML
        associations[".xht"] = LanguageScope.HTML
        associations[".mdoc"] = LanguageScope.HTML
        associations[".jsp"] = LanguageScope.HTML
        associations[".asp"] = LanguageScope.HTML
        associations[".aspx"] = LanguageScope.HTML
        associations[".jshtm"] = LanguageScope.HTML
        associations[".volt"] = LanguageScope.HTML
        associations[".ejs"] = LanguageScope.HTML
        associations[".rhtml"] = LanguageScope.HTML
        associations[".ini"] = LanguageScope.INI
        associations[".env"] = LanguageScope.INI
        associations[".conf"] = LanguageScope.INI
        associations[".properties"] = LanguageScope.INI
        associations[".cfg"] = LanguageScope.INI
        associations[".directory"] = LanguageScope.INI
        associations[".gitattributes"] = LanguageScope.INI
        associations[".gitconfig"] = LanguageScope.INI
        associations[".gitmodules"] = LanguageScope.INI
        associations[".editorconfig"] = LanguageScope.INI
        associations[".repo"] = LanguageScope.INI
        associations[".java"] = LanguageScope.JAVA
        associations[".jav"] = LanguageScope.JAVA
        associations[".js"] = LanguageScope.JAVASCRIPT
        associations[".jsx"] = LanguageScope.JAVASCRIPT
        associations[".mjs"] = LanguageScope.JAVASCRIPT
        associations[".cjs"] = LanguageScope.JAVASCRIPT
        associations[".es6"] = LanguageScope.JAVASCRIPT
        associations[".pac"] = LanguageScope.JAVASCRIPT
        associations[".json"] = LanguageScope.JSON
        associations[".jl"] = LanguageScope.JULIA
        associations[".kt"] = LanguageScope.KOTLIN
        associations[".kts"] = LanguageScope.KOTLIN
        associations[".tex"] = LanguageScope.LATEX
        associations[".ltx"] = LanguageScope.LATEX
        associations[".ctx"] = LanguageScope.LATEX
        associations[".lisp"] = LanguageScope.LISP
        associations[".lsp"] = LanguageScope.LISP
        associations[".cl"] = LanguageScope.LISP
        associations[".l"] = LanguageScope.LISP
        associations[".lua"] = LanguageScope.LUA
        associations[".Makefile"] = LanguageScope.MAKE
        associations[".mak"] = LanguageScope.MAKE
        associations[".mk"] = LanguageScope.MAKE
        associations[".md"] = LanguageScope.MARKDOWN
        associations[".mkd"] = LanguageScope.MARKDOWN
        associations[".mdwn"] = LanguageScope.MARKDOWN
        associations[".mdown"] = LanguageScope.MARKDOWN
        associations[".markdown"] = LanguageScope.MARKDOWN
        associations[".markdn"] = LanguageScope.MARKDOWN
        associations[".mdtxt"] = LanguageScope.MARKDOWN
        associations[".mdtext"] = LanguageScope.MARKDOWN
        associations[".workbook"] = LanguageScope.MARKDOWN
        associations[".pl"] = LanguageScope.PERL
        associations[".pm"] = LanguageScope.PERL
        associations[".pod"] = LanguageScope.PERL
        associations[".t"] = LanguageScope.PERL
        associations[".psgi"] = LanguageScope.PERL
        associations[".raku"] = LanguageScope.PERL
        associations[".rakumod"] = LanguageScope.PERL
        associations[".rakutest"] = LanguageScope.PERL
        associations[".rakudoc"] = LanguageScope.PERL
        associations[".nqp"] = LanguageScope.PERL
        associations[".p6"] = LanguageScope.PERL
        associations[".pl6"] = LanguageScope.PERL
        associations[".pm6"] = LanguageScope.PERL
        associations[".php"] = LanguageScope.PHP
        associations[".php4"] = LanguageScope.PHP
        associations[".php5"] = LanguageScope.PHP
        associations[".phtml"] = LanguageScope.PHP
        associations[".ctp"] = LanguageScope.PHP
        associations[".txt"] = LanguageScope.TEXT
        associations[".log"] = LanguageScope.TEXT
        associations[".py"] = LanguageScope.PYTHON
        associations[".rpy"] = LanguageScope.PYTHON
        associations[".pyw"] = LanguageScope.PYTHON
        associations[".cpy"] = LanguageScope.PYTHON
        associations[".gyp"] = LanguageScope.PYTHON
        associations[".gypi"] = LanguageScope.PYTHON
        associations[".pyi"] = LanguageScope.PYTHON
        associations[".ipy"] = LanguageScope.PYTHON
        associations[".pyt"] = LanguageScope.PYTHON
        associations[".rb"] = LanguageScope.RUBY
        associations[".rbx"] = LanguageScope.RUBY
        associations[".rjs"] = LanguageScope.RUBY
        associations[".gemspec"] = LanguageScope.RUBY
        associations[".rake"] = LanguageScope.RUBY
        associations[".ru"] = LanguageScope.RUBY
        associations[".erb"] = LanguageScope.RUBY
        associations[".podspec"] = LanguageScope.RUBY
        associations[".rbi"] = LanguageScope.RUBY
        associations["Rakefile"] = LanguageScope.RUBY
        associations["Gemfile"] = LanguageScope.RUBY
        associations["Guardfile"] = LanguageScope.RUBY
        associations["Podfile"] = LanguageScope.RUBY
        associations["Capfile"] = LanguageScope.RUBY
        associations["Cheffile"] = LanguageScope.RUBY
        associations["Hobofile"] = LanguageScope.RUBY
        associations["Vagrantfile"] = LanguageScope.RUBY
        associations["Appraisals"] = LanguageScope.RUBY
        associations["Rantfile"] = LanguageScope.RUBY
        associations["Berksfile"] = LanguageScope.RUBY
        associations["Thorfile"] = LanguageScope.RUBY
        associations["Puppetfile"] = LanguageScope.RUBY
        associations["Dangerfile"] = LanguageScope.RUBY
        associations["Brewfile"] = LanguageScope.RUBY
        associations["Fastfile"] = LanguageScope.RUBY
        associations["Appfile"] = LanguageScope.RUBY
        associations["Deliverfile"] = LanguageScope.RUBY
        associations["Matchfile"] = LanguageScope.RUBY
        associations["Scanfile"] = LanguageScope.RUBY
        associations["Snapfile"] = LanguageScope.RUBY
        associations["Gymfile"] = LanguageScope.RUBY
        associations[".rs"] = LanguageScope.RUST
        associations[".sh"] = LanguageScope.SHELL
        associations[".bash"] = LanguageScope.SHELL
        associations[".bashrc"] = LanguageScope.SHELL
        associations[".bash_aliases"] = LanguageScope.SHELL
        associations[".bash_profile"] = LanguageScope.SHELL
        associations[".bash_login"] = LanguageScope.SHELL
        associations[".ebuild"] = LanguageScope.SHELL
        associations[".profile"] = LanguageScope.SHELL
        associations[".bash_logout"] = LanguageScope.SHELL
        associations[".xprofile"] = LanguageScope.SHELL
        associations[".xsession"] = LanguageScope.SHELL
        associations[".xsessionrc"] = LanguageScope.SHELL
        associations[".zsh"] = LanguageScope.SHELL
        associations[".zshrc"] = LanguageScope.SHELL
        associations[".zprofile"] = LanguageScope.SHELL
        associations[".zlogin"] = LanguageScope.SHELL
        associations[".zlogout"] = LanguageScope.SHELL
        associations[".zshenv"] = LanguageScope.SHELL
        associations[".zsh-theme"] = LanguageScope.SHELL
        associations[".fish"] = LanguageScope.SHELL
        associations[".ksh"] = LanguageScope.SHELL
        associations[".csh"] = LanguageScope.SHELL
        associations[".cshrc"] = LanguageScope.SHELL
        associations[".tcshrc"] = LanguageScope.SHELL
        associations[".yashrc"] = LanguageScope.SHELL
        associations[".yash_profile"] = LanguageScope.SHELL
        associations[".bsh"] = LanguageScope.SHELL
        associations[".tcsh"] = LanguageScope.SHELL
        associations[".smali"] = LanguageScope.SMALI
        associations[".sql"] = LanguageScope.SQL
        associations[".dsql"] = LanguageScope.SQL
        associations[".sqlite"] = LanguageScope.SQL
        associations[".sqlite2"] = LanguageScope.SQL
        associations[".sqlite3"] = LanguageScope.SQL
        associations[".toml"] = LanguageScope.TOML
        associations[".ts"] = LanguageScope.TYPESCRIPT
        associations[".tsx"] = LanguageScope.TYPESCRIPT
        associations[".mts"] = LanguageScope.TYPESCRIPT
        associations[".cts"] = LanguageScope.TYPESCRIPT
        associations[".vb"] = LanguageScope.VISUALBASIC
        associations[".brs"] = LanguageScope.VISUALBASIC
        associations[".vbs"] = LanguageScope.VISUALBASIC
        associations[".bas"] = LanguageScope.VISUALBASIC
        associations[".vba"] = LanguageScope.VISUALBASIC
        associations[".xml"] = LanguageScope.XML
        associations[".xsd"] = LanguageScope.XML
        associations[".ascx"] = LanguageScope.XML
        associations[".atom"] = LanguageScope.XML
        associations[".axml"] = LanguageScope.XML
        associations[".axaml"] = LanguageScope.XML
        associations[".bpmn"] = LanguageScope.XML
        associations[".cpt"] = LanguageScope.XML
        associations[".csl"] = LanguageScope.XML
        associations[".csproj"] = LanguageScope.XML
        associations[".dita"] = LanguageScope.XML
        associations[".ditamap"] = LanguageScope.XML
        associations[".dtd"] = LanguageScope.XML
        associations[".ent"] = LanguageScope.XML
        associations[".dtml"] = LanguageScope.XML
        associations[".fsproj"] = LanguageScope.XML
        associations[".fxml"] = LanguageScope.XML
        associations[".iml"] = LanguageScope.XML
        associations[".isml"] = LanguageScope.XML
        associations[".jmx"] = LanguageScope.XML
        associations[".launch"] = LanguageScope.XML
        associations[".menu"] = LanguageScope.XML
        associations[".mxml"] = LanguageScope.XML
        associations[".nuspec"] = LanguageScope.XML
        associations[".opml"] = LanguageScope.XML
        associations[".owl"] = LanguageScope.XML
        associations[".proj"] = LanguageScope.XML
        associations[".props"] = LanguageScope.XML
        associations[".pt"] = LanguageScope.XML
        associations[".publishsettings"] = LanguageScope.XML
        associations[".pubxml"] = LanguageScope.XML
        associations[".rbxlx"] = LanguageScope.XML
        associations[".rbxmx"] = LanguageScope.XML
        associations[".rdf"] = LanguageScope.XML
        associations[".rng"] = LanguageScope.XML
        associations[".rss"] = LanguageScope.XML
        associations[".shproj"] = LanguageScope.XML
        associations[".storyboard"] = LanguageScope.XML
        associations[".targets"] = LanguageScope.XML
        associations[".tld"] = LanguageScope.XML
        associations[".tmx"] = LanguageScope.XML
        associations[".vbproj"] = LanguageScope.XML
        associations[".vcxproj"] = LanguageScope.XML
        associations[".wsdl"] = LanguageScope.XML
        associations[".wxi"] = LanguageScope.XML
        associations[".wxl"] = LanguageScope.XML
        associations[".wxs"] = LanguageScope.XML
        associations[".xaml"] = LanguageScope.XML
        associations[".xbl"] = LanguageScope.XML
        associations[".xib"] = LanguageScope.XML
        associations[".xlf"] = LanguageScope.XML
        associations[".xliff"] = LanguageScope.XML
        associations[".xpdl"] = LanguageScope.XML
        associations[".xul"] = LanguageScope.XML
        associations[".xoml"] = LanguageScope.XML
        associations[".yaml"] = LanguageScope.YAML
        associations[".yml"] = LanguageScope.YAML
        associations[".eyaml"] = LanguageScope.YAML
        associations[".eyml"] = LanguageScope.YAML
        associations[".cff"] = LanguageScope.YAML
        associations[".zig"] = LanguageScope.ZIG
        associations[".zon"] = LanguageScope.ZIG
        associations[".vue"] = LanguageScope.VUE
    }

    fun guessLanguage(extension: String): String? {
        return associations[extension]
    }
}